import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

const viewRouter = new Router({
  routes: [
    {
      path: '/',
      component: ()=> import('views_app/minerInvitation.vue'),
      meta: {
        title: '邀请矿工绑定'
      }
    },
    {
      path: '/minerRegister',
      component: ()=> import('views_app/minerRegister.vue'),
      meta: {
        title: '邀请矿工绑定'
      }
    },
    {
      path: '/invitationResult',
      component: ()=> import('views_app/invitationResult.vue'),
      meta: {
        title: '邀请矿工绑定'
      }
    }
  ]
})

viewRouter.beforeEach((to, from, next) => {
  if (to.meta.title) {
    document.title = to.meta.title
  }
  next()
})


export default viewRouter
